using System;
using EPiServer.Common;
using EPiServer.Common.Queries;
using EPiServer.Common.Security;
using EPiServer.Community.Blog;
using EPiServer.Community.Club;
using EPiServer.Community.Club.Queries;
using EPiServer.Community.Poll;

namespace EPiAbstractions.Community.Club
{
    public interface IClubHandlerFacade
    {
        EPiServer.Community.Club.Club AddClub(EPiServer.Community.Club.Club club);

        void RemoveClub(EPiServer.Community.Club.Club club);

        void RemoveClub(EPiServer.Community.Club.Club club, Boolean permanent);

        void UpdateClub(EPiServer.Community.Club.Club club);

        EPiServer.Community.Club.Club GetClub(Int32 id);

        ClubCollection GetClubs(String name);

        ClubCollection GetClubs(ClubApproval clubApproval, Int32 page, Int32 pageSize, ClubSortOrder[] sortOrder);

        ClubCollection GetClubs(ClubApproval clubApproval, Int32 page, Int32 pageSize, out Int32 totalItems, ClubSortOrder[] sortOrder);

        ClubCollection GetClubs(ClubApproval clubApproval, ClubHideStatus clubHideStatus, Int32 page, Int32 pageSize,
                                ClubSortOrder[] sortOrder);

        ClubCollection GetClubs(ClubApproval clubApproval, ClubHideStatus clubHideStatus, Int32 page, Int32 pageSize, out Int32 totalItems,
                                ClubSortOrder[] sortOrder);

        ClubCollection GetClubs(SiteCollection sites, ClubApproval clubApproval, ClubHideStatus clubHideStatus, Int32 page, Int32 pageSize,
                                ClubSortOrder[] sortOrder);

        ClubCollection GetClubs(SiteCollection sites, ClubApproval clubApproval, ClubHideStatus clubHideStatus, Int32 page, Int32 pageSize,
                                out Int32 totalItems, ClubSortOrder[] sortOrder);

        ClubCollection GetClubs(SiteCollection sites, NullValueAction siteNullAction, ClubApproval clubApproval,
                                ClubHideStatus clubHideStatus, Int32 page, Int32 pageSize, ClubSortOrder[] sortOrder);

        ClubCollection GetClubs(SiteCollection sites, NullValueAction siteNullAction, ClubApproval clubApproval,
                                ClubHideStatus clubHideStatus, Int32 page, Int32 pageSize, out Int32 totalItems, ClubSortOrder[] sortOrder);

        ClubCollection GetMyClubs(IUser user, Int32 page, Int32 pageSize, ClubSortOrder[] sortOrder);

        ClubCollection GetMyClubs(IUser user, Int32 page, Int32 pageSize, out Int32 totalItems, ClubSortOrder[] sortOrder);

        ClubCollection GetMyClubs(IUser user, ClubHideStatus clubHideStatus, Int32 page, Int32 pageSize, ClubSortOrder[] sortOrder);

        ClubCollection GetMyClubs(IUser user, ClubHideStatus clubHideStatus, Int32 page, Int32 pageSize, out Int32 totalItems,
                                  ClubSortOrder[] sortOrder);

        ClubCollection GetMyClubs(IUser user, SiteCollection sites, ClubHideStatus clubHideStatus, Int32 page, Int32 pageSize,
                                  ClubSortOrder[] sortOrder);

        ClubCollection GetMyClubs(IUser user, SiteCollection sites, ClubHideStatus clubHideStatus, Int32 page, Int32 pageSize,
                                  out Int32 totalItems, ClubSortOrder[] sortOrder);

        ClubCollection GetMyClubs(IUser user, SiteCollection sites, NullValueAction siteNullAction, ClubHideStatus clubHideStatus,
                                  Int32 page, Int32 pageSize, ClubSortOrder[] sortOrder);

        ClubCollection GetMyClubs(IUser user, SiteCollection sites, NullValueAction siteNullAction, ClubHideStatus clubHideStatus,
                                  Int32 page, Int32 pageSize, out Int32 totalItems, ClubSortOrder[] sortOrder);

        ClubCollection GetRelatedClubs(EPiServer.Community.Club.Club club, Int32 minRelatedMembers, Int32 minRelatedMemberPercentage,
                                       Int32 page, Int32 pageSize, ClubSortOrder[] sortOrder);

        ClubCollection GetRelatedClubs(EPiServer.Community.Club.Club club, Int32 minRelatedMembers, Int32 minRelatedMemberPercentage,
                                       Int32 page, Int32 pageSize, out Int32 totalItems, ClubSortOrder[] sortOrder);

        ClubCollection GetRelatedClubs(EPiServer.Community.Club.Club club, Int32 minRelatedMembers, Int32 minRelatedMemberPercentage,
                                       ClubHideStatus clubHideStatus, Int32 page, Int32 pageSize, ClubSortOrder[] sortOrder);

        ClubCollection GetRelatedClubs(EPiServer.Community.Club.Club club, Int32 minRelatedMembers, Int32 minRelatedMemberPercentage,
                                       ClubHideStatus clubHideStatus, Int32 page, Int32 pageSize, out Int32 totalItems,
                                       ClubSortOrder[] sortOrder);

        ClubCollection GetRelatedClubs(EPiServer.Community.Club.Club club, SiteCollection sites, Int32 minRelatedMembers,
                                       Int32 minRelatedMemberPercentage, ClubHideStatus clubHideStatus, Int32 page, Int32 pageSize,
                                       ClubSortOrder[] sortOrder);

        ClubCollection GetRelatedClubs(EPiServer.Community.Club.Club club, SiteCollection sites, Int32 minRelatedMembers,
                                       Int32 minRelatedMemberPercentage, ClubHideStatus clubHideStatus, Int32 page, Int32 pageSize,
                                       out Int32 totalItems, ClubSortOrder[] sortOrder);

        ClubCollection GetRelatedClubs(EPiServer.Community.Club.Club club, SiteCollection sites, NullValueAction siteNullAction,
                                       Int32 minRelatedMembers, Int32 minRelatedMemberPercentage, ClubHideStatus clubHideStatus, Int32 page,
                                       Int32 pageSize, ClubSortOrder[] sortOrder);

        ClubCollection GetRelatedClubs(EPiServer.Community.Club.Club club, SiteCollection sites, NullValueAction siteNullAction,
                                       Int32 minRelatedMembers, Int32 minRelatedMemberPercentage, ClubHideStatus clubHideStatus, Int32 page,
                                       Int32 pageSize, out Int32 totalItems, ClubSortOrder[] sortOrder);

        Membership AddMembership(Membership cm);

        void UpdateMembership(Membership cm);

        void RemoveMembership(Membership cm);

        MembershipCollection GetMembers(EPiServer.Community.Club.Club club, Int32 page, Int32 pageSize, MembershipSortOrder[] sortOrder);

        MembershipCollection GetMembers(EPiServer.Community.Club.Club club, Int32 page, Int32 pageSize, out Int32 totalItems,
                                        MembershipSortOrder[] sortOrder);

        MembershipCollection GetMembers(EPiServer.Community.Club.Club club, MembershipApproval approval, Int32 page, Int32 pageSize,
                                        MembershipSortOrder[] sortOrder);

        MembershipCollection GetMembers(EPiServer.Community.Club.Club club, MembershipApproval approval, Int32 page, Int32 pageSize,
                                        out Int32 totalItems, MembershipSortOrder[] sortOrder);

        Membership GetMembership(Int32 id);

        Membership GetMembership(EPiServer.Community.Club.Club club, IUser user);

        PollCollection GetClubPolls(EPiServer.Community.Club.Club club, Int32 page, Int32 pageSize, PollSortOrder[] order);

        PollCollection GetClubPolls(EPiServer.Community.Club.Club club, Int32 page, Int32 pageSize, out Int32 totalItems,
                                    PollSortOrder[] order);

        Poll AddClubPoll(EPiServer.Community.Club.Club club, Poll poll);

        void RemoveClubPoll(EPiServer.Community.Club.Club club, Poll poll);

        Ad AddAd(Ad ad);

        void UpdateAd(Ad ad);

        void RemoveAd(Ad ad);

        Ad GetAd(Int32 id);

        AdCollection GetAds(AdApproval adApproval, Int32 page, Int32 pageSize, AdSortOrder[] sortOrder);

        AdCollection GetAds(AdApproval adApproval, Int32 page, Int32 pageSize, out Int32 totalItems, AdSortOrder[] sortOrder);

        AdCollection GetAds(SiteCollection sites, AdApproval adApproval, Int32 page, Int32 pageSize, AdSortOrder[] sortOrder);

        AdCollection GetAds(SiteCollection sites, AdApproval adApproval, Int32 page, Int32 pageSize, out Int32 totalItems,
                            AdSortOrder[] sortOrder);

        AdCollection GetAds(EPiServer.Community.Club.Club club, AdApproval adApproval, Int32 page, Int32 pageSize, AdSortOrder[] sortOrder);

        AdCollection GetAds(EPiServer.Community.Club.Club club, AdApproval adApproval, Int32 page, Int32 pageSize, out Int32 totalItems,
                            AdSortOrder[] sortOrder);

        AdCollection GetAds(EPiServer.Community.Club.Club club, SiteCollection sites, AdApproval adApproval, Int32 page, Int32 pageSize,
                            AdSortOrder[] sortOrder);

        AdCollection GetAds(EPiServer.Community.Club.Club club, SiteCollection sites, AdApproval adApproval, Int32 page, Int32 pageSize,
                            out Int32 totalItems, AdSortOrder[] sortOrder);

        AdCollection GetAds(EPiServer.Community.Club.Club club, SiteCollection sites, NullValueAction siteNullAction, AdApproval adApproval,
                            Int32 page, Int32 pageSize, AdSortOrder[] sortOrder);

        AdCollection GetAds(EPiServer.Community.Club.Club club, SiteCollection sites, NullValueAction siteNullAction, AdApproval adApproval,
                            Int32 page, Int32 pageSize, out Int32 totalItems, AdSortOrder[] sortOrder);

        EntryCollection GetClubEntries(IUser user, ClubBlogType clubBlogType, ReadStatus readStatus, Int32 page, Int32 pageSize,
                                       EntrySortOrder[] sortOrder);

        EntryCollection GetClubEntries(IUser user, ClubBlogType clubBlogType, ReadStatus readStatus, Int32 page, Int32 pageSize,
                                       out Int32 totalItems, EntrySortOrder[] sortOrder);

        Int32 GetNumClubEntries(IUser user, ClubBlogType clubBlogType, ReadStatus readStatus);

        event EPiServerCommonEventHandler ClubAdded;

        event EPiServerCommonEventHandler ClubOpenAdded;

        event EPiServerCommonEventHandler ClubClosedAdded;

        event EPiServerCommonEventHandler ClubUpdated;

        event EPiServerCommonEventHandler ClubRemoved;

        event EPiServerCommonEventHandler AdAdded;

        event EPiServerCommonEventHandler AdUpdated;

        event EPiServerCommonEventHandler AdRemoved;

        event EPiServerCommonEventHandler PollAdded;

        event EPiServerCommonEventHandler PollRemoved;

        event EPiServerCommonEventHandler MembershipAdded;

        event EPiServerCommonEventHandler MembershipUpdated;

        event EPiServerCommonEventHandler MembershipRemoved;

        AdCollection GetQueryResult(AdQuery query);

        AdCollection GetQueryResult(AdQuery query, Int32 page, Int32 pageSize);

        AdCollection GetQueryResult(AdQuery query, Int32 page, Int32 pageSize, out Int32 totalItems);

        ClubCollection GetQueryResult(ClubQuery query);

        ClubCollection GetQueryResult(ClubQuery query, Int32 page, Int32 pageSize);

        ClubCollection GetQueryResult(ClubQuery query, Int32 page, Int32 pageSize, out Int32 totalItems);

        MembershipCollection GetQueryResult(MembershipQuery query);

        MembershipCollection GetQueryResult(MembershipQuery query, Int32 page, Int32 pageSize);

        MembershipCollection GetQueryResult(MembershipQuery query, Int32 page, Int32 pageSize, out Int32 totalItems);
    }
}